<template>
  <div>
    <el-dialog :visible.sync="dialog.detail" title="详情" width="80%" append-to-body>
      <div class="detail-info">
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">商品类目名称：</span><span v-text="form.categoryTitle"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">商品类目是否可用：</span><span v-text="form.categoryIsActive"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">店铺标题：</span><span v-text="form.shopTitle"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">店铺是否可用：</span><span v-text="form.shopIsActive"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">商品标题：</span><span v-text="form.goodsTitle"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">商品是否可用：</span><span v-text="form.goodsIsActive"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">售卖标题：</span><span v-text="form.skuTitle"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">SKU是否可用：</span><span v-text="form.skuIsActive"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">优惠券标题：</span><span v-text="form.title"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">最小消费金额（元）：</span><span v-text="form.useMinAmount"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">满减优惠金额（元）：</span><span v-text="form.discountAmount"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">满减折扣：</span><span v-text="form.discountPercent"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">赠送积分：</span><span v-text="form.integralAmount"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">优惠券总量：</span><span v-text="form.totalCount"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">优惠券使用范围：</span><span v-text="form.couponUsableRange"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">优惠券类型：</span><span v-text="form.couponType"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">开始时间：</span><span v-text="form.startTime"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">到期时间：</span><span v-text="form.dueTime"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">有效时间：</span><span v-text="form.validDays"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">版本号：</span><span v-text="form.version"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">创建时间：</span><span v-text="form.createTime"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">更新时间：</span><span v-text="form.updateTime"></span></el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8"><span class="detail-title">是否可用：</span><span v-text="form.isActive"></span></el-col>

        </el-row>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialog.detail = false">关闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import * as utils from '@/utils/utils'
import * as ResponseStatus from '@/utils/response-status'
const resUrl = process.env.VUE_APP_RES_URL
export default {
  name: 'GoodsCouponDetail',
  data() {
    return {
      dialog: {
        detail: false
      },
      form: {
        id: undefined,
categoryId: undefined,
categoryTitle: undefined,
categoryIsActive: undefined,
shopId: undefined,
shopTitle: undefined,
shopIsActive: undefined,
goodsId: undefined,
goodsTitle: undefined,
goodsPicUrl: undefined,
goodsIsActive: undefined,
goodsSkuId: undefined,
skuTitle: undefined,
skuPicUrl: undefined,
skuIsActive: undefined,
title: undefined,
useMinAmount: undefined,
discountAmount: undefined,
discountPercent: undefined,
integralAmount: undefined,
totalCount: undefined,
couponUsableRange: undefined,
couponType: undefined,
startTime: undefined,
dueTime: undefined,
validDays: undefined,
version: undefined,
createTime: undefined,
updateTime: undefined,
isActive: undefined,

      },
      dataDictCodes: ['YES_NO','COUPON_USABLE_RANGE','COUPON_TYPE',],
      resUrl: resUrl
    }
  },
  computed: {},
  mounted() {},
  methods: {
    getDictItemsDisplayValue() {
      utils
        .getDataDict(this.dataDictCodes)
        .then(response => {
          if (response) {
            if (response) {
              utils.getDetailDictItemDisplayValue({
                mainComponent: this,
                dataDictItems: response,
                dictCode: 'YES_NO',
                formProp: 'categoryIsActive'
              })
utils.getDetailDictItemDisplayValue({
                mainComponent: this,
                dataDictItems: response,
                dictCode: 'YES_NO',
                formProp: 'shopIsActive'
              })
utils.getDetailDictItemDisplayValue({
                mainComponent: this,
                dataDictItems: response,
                dictCode: 'YES_NO',
                formProp: 'goodsIsActive'
              })
utils.getDetailDictItemDisplayValue({
                mainComponent: this,
                dataDictItems: response,
                dictCode: 'YES_NO',
                formProp: 'skuIsActive'
              })
utils.getDetailDictItemDisplayValue({
                mainComponent: this,
                dataDictItems: response,
                dictCode: 'COUPON_USABLE_RANGE',
                formProp: 'couponUsableRange'
              })
utils.getDetailDictItemDisplayValue({
                mainComponent: this,
                dataDictItems: response,
                dictCode: 'COUPON_TYPE',
                formProp: 'couponType'
              })
utils.getDetailDictItemDisplayValue({
                mainComponent: this,
                dataDictItems: response,
                dictCode: 'YES_NO',
                formProp: 'isActive'
              })

            }
          }
        })
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>

<style>
</style>